package m.jclecai.com.activity;

import android.text.TextUtils;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;

import butterknife.BindView;
import m.jclecai.com.R;
import m.jclecai.com.base.BaseActivity;
import m.jclecai.com.bean.AccountParticularsBean;

/**
 * Created by ZD on 2017/6/3.
 * 提现详情
 */

public class WithdrawDetailActivity extends BaseActivity {

    AccountParticularsBean bean;
    @BindView(R.id.tv_one)
    TextView tvOne;
    @BindView(R.id.tv_two)
    TextView tvTwo;
    @BindView(R.id.tv_three)
    TextView tvThree;
    @BindView(R.id.tv_four)
    TextView tvFour;
    @BindView(R.id.tv_five)
    TextView tvFive;
    @BindView(R.id.tv_six)
    TextView tvSix;

    @Override
    protected int getContentView() {
        return R.layout.activity_withdraw_detail;
    }

    @Override
    protected void initView() {
        super.initView();
        leftOptionText("");
        setTitle("详情");
    }

    @Override
    protected void resetWindow() {

    }

    @Override
    protected void initData() {
        super.initData();
        bean = JSON.parseObject(getIntent().getStringExtra("bean"), AccountParticularsBean.class);
        String backMoney = bean.getBack_money();
        String goMoney = bean.getGo_money();
        try {
            if (!TextUtils.isEmpty(backMoney) && Float.valueOf(backMoney) != 0) {
                tvOne.setText(("+" + backMoney));
            }
            if (!TextUtils.isEmpty(goMoney) && Float.valueOf(goMoney) != 0) {
                tvOne.setText(("-" + goMoney));
            }
        } catch (Exception e) {
            tvOne.setText("0.0");
            e.printStackTrace();
        }
        tvTwo.setText(bean.getBalance());
        tvThree.setText(bean.getAddtime());
        tvFour.setText(bean.getProjectno());
        tvFive.setText(bean.getOrderName());
        tvSix.setText(bean.getContent());
    }
}
